package com.bingfabao.countDown;

import java.util.Random;
import java.util.concurrent.CountDownLatch;

/**
 * @author: LCG
 * 作者: LCG
 * 日期: 2021/2/25  13:34
 * 描述:
 */

public class MyCountDown implements Runnable {

    private CountDownLatch countDownLatch;

    public MyCountDown(CountDownLatch countDownLatch) {
        this.countDownLatch = countDownLatch;
    }

    @Override
    public void run() {

        try {
            Thread.sleep(new Random().nextInt(10000));
            System.out.println(Thread.currentThread().getName()+"=========到达门口");
            countDownLatch.countDown();
        } catch (InterruptedException e) {
            e.printStackTrace();
        }


    }
}
